var ALBUM=0;
function ChangeName(albumid){
var value = $("#editField").text();
ALBUM=albumid;
$("#editField").empty();

$("#editField").append("<input type='text' id='editText' onkeyPress=\"javascript:ChangeNameCheck(event);\" value='"+value+"'>");

}

function ChangeNameCheck(e){

var charCode; if(e && e.which){
charCode = e.which;
}else if(window.event){
e = window.event;
charCode = e.keyCode;
}
if (charCode==13) {
SaveName();	
}

}

function SaveName(){
var value = $("input#editText").val();
if(value.length<1){
alert("Data is too short");
}
else {
Azaria.GetContent("gallery-ajaxtools","&Album="+ALBUM+"&Value="+value);
$("#editField").empty();
$("#editField").append(value);
}
}
